<script setup lang="ts">
import { computed } from "vue";
import Result from "./Result.vue";

const { source, hiddenBtn } = defineProps<{
    source: any,
    hiddenBtn?: boolean;
}>();


defineEmits<{
    btnTap: [];
}>();

const resultView = computed(() => {
    let { audit_status } = source;
    const refused = audit_status === 2;
    // const desc = refused ? (!simple ? `原因：${audit_reason}\n` : '') + `如有疑问，请微信联系:CDJNH2020` : "请耐心等待审核结果";
    const desc = refused ? `如有疑问，请微信联系:CDJNH2020` : "平台将在7个工作日内审核完成，\n请耐心等待审核结果";

    return {
        desc,
        image: `/static/svg/settled-${refused ? 'refused' : 'sus'}.svg`,
        title: refused ? '很遗憾，审核不通过' : '已提交申请',
        // btnText: hiddenBtn ? undefined : (refused ? "重新提交" : "开启通知"),
        btnText: hiddenBtn ? undefined : (refused ? undefined : "开启通知"),
    };
});

</script>

<template>
    <Result v-bind="resultView" @btn-tap="$emit('btnTap')" />
</template>